/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.raitcon.hibernate.db;


import com.raitcon.hibernate.bean.Pais;
import com.raitcon.hibernate.factory.HibernateUtil;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.Query;
import org.hibernate.Session;

/**
 *
 * @author Mike
 */
public class PaisDB {
    
private static final Log log = LogFactory.getLog(PaisDB.class);
        
   private Session session=null;
   
   public PaisDB(){
       
       this.session = HibernateUtil.getSessionFactory().getCurrentSession();
   }
    
    
    
    
    
    
    public List getPaisAll() {
        List<Pais> menuList = null;
        try {
           org.hibernate.Transaction tx = session.beginTransaction();
            Query q = session.createQuery ("from Pais as pais");
            menuList = (List<Pais>) q.list();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return menuList;
      } 
    
}
